package com.rockcent.mall.lib.repository;

import com.rockcent.mall.lib.domain.RockcentFund;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Lock;
import org.springframework.stereotype.Repository;

import javax.persistence.LockModeType;

/**
 *
 * 乐宸资金账户
 * Created by zhangjh on 17/03/08.
 */
@Repository
public interface RockcentFundRepository  extends JpaRepository<RockcentFund, Long>, JpaSpecificationExecutor {

    @Lock(LockModeType.PESSIMISTIC_WRITE)
    RockcentFund findOne(Long id);

    RockcentFund findTop1ById(long id);
}
